package spring.cloud.chapter2.utils;

import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

public class ResponseUtils {

    public static <T>ResponseEntity<T> generateResponseEntity(T data, HttpStatus status, Boolean success, String message){
        HttpHeaders headers = new HttpHeaders();
        headers.add("success",success.toString());
        headers.add("message",message);
        ResponseEntity<T> response = new ResponseEntity<>(data,headers,status);
        return response;
    }
}
